﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using InterpriseSuiteEcommerceCommon.Extensions;

namespace InterpriseSuiteEcommerceCommon.DataAccess
{
    public class OrderDA
    {
        public static void ClearEcommerceCartShippingAddressIDForAnonCustomer(string anonCustomerCode, string WebsiteCode)
        {
            using (var con = new SqlConnection(DB.GetDBConn()))
            {
                con.Open();
                DB.ExecuteSQL(String.Format("UPDATE ecommerceShoppingCart SET ShippingAddressID = null WHERE CustomerCode={0} AND WebSiteCode = {1}", 
                                anonCustomerCode.ToDbQuote(), WebsiteCode.ToDbQuote()), con);
                con.Close();
            }
        }
    }
}